<template>
  <div>
    <div style="text-align: center">
      <el-image class="moyuimage" :src="moyuimage"></el-image>
    </div>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      moyuimage: null
    };
  },
  methods: {
    async getImage() {
      this.moyuimage = 'https://api.vvhan.com/api/moyu?end=' + Math.random()
      // await this.$http.get('https://api.vvhan.com/api/moyu', {
      //   responseType: 'blob'
      // }).then(res => {
      //   console.log(res)
      //   const imageUrl = URL.createObjectURL(res);
      //   this.moyuimage = imageUrl
      // })
    }
  },
  activated: function(){
    this.getImage()
  }
}
</script>

<style lang="scss" scoped>
.moyuimage{
  height: 700px;
  width: 400px;
}
</style>
